# ALTERNATIVE: local su ident will always work (but dangerous!)
# PG_EXPORTER_URL='postgres:///postgres?host=/var/run/postgresql&sslmode=disable'
{% if pg_exporter_url != '' %}
PG_EXPORTER_URL='{{ pg_exporter_url }}'    # from pg_exporter_url
{% else %}
PG_EXPORTER_URL='postgres://{{ pg_monitor_username }}:{{ pg_monitor_password }}@:{{ pg_port }}/postgres?host={{ pg_localhost }}&sslmode=disable'
{% endif %}
{% if pg_exporter_auto_discovery|bool %}
PG_EXPORTER_AUTO_DISCOVERY=true
{% else %}
PG_EXPORTER_AUTO_DISCOVERY=false
{% endif %}
PG_EXPORTER_EXCLUDE_DATABASE="{{ pg_exporter_exclude_database|default('template0,template1,postgres') }}"
PG_EXPORTER_INCLUDE_DATABASE="{{ pg_exporter_include_database|default('') }}"
PG_EXPORTER_CONFIG=/etc/pg_exporter/pg_exporter.yml
PG_EXPORTER_LISTEN_ADDRESS=":{{ pg_exporter_port }}"
PG_EXPORTER_TELEMETRY_PATH="{{ exporter_metrics_path }}"
PG_EXPORTER_DISABLE_CACHE=false
# PG_EXPORTER_OPTS='--log.level=info --log.format="logger:syslog?appname=pg_exporter&local=7"'
PG_EXPORTER_OPTS={{ pg_exporter_options }}